﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ObjectOuster
{
    public partial class VolumeControl : UserControl
    {
        public VolumeControl()
        {
            InitializeComponent();
        }

        private void soundToggle_Checked(object sender, RoutedEventArgs e)
        {
            GameConfig.SoundEffects.Muted = false;
        }

        private void musicToggle_Checked(object sender, RoutedEventArgs e)
        {
            GameConfig.Music.Muted = false;
        }

        private void soundToggle_Unchecked(object sender, RoutedEventArgs e)
        {
            GameConfig.SoundEffects.Muted = true;
        }

        private void musicToggle_Unchecked(object sender, RoutedEventArgs e)
        {
            GameConfig.Music.Muted = true;
        }

        private void soundSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            GameConfig.SoundEffects.Volume = e.NewValue / 100.0;
        }

        private void musicSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            GameConfig.Music.Volume = e.NewValue / 100.0;
        }
    }
}
